﻿using System;
using System.Collections.Generic;
using System.Collections.ObjectModel;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using GurLoader.CommandLineOptions;
using NUnit.Framework;

namespace GurLoaderWPF.Test.Preferences
{
    [TestFixture]
    public class SendImagesOptionsTests
    {
        [Test]
        public void FilesContainedTest()
        {
            string[] files = {"C:\\images\\a.jpg", "c:\\images\\b.jpg", "c:\\images\\c.jpg"};

            var o = new SendImagesOptions()
            {
                Files = files
            };

            Assert.IsNotNull(o);
            CollectionAssert.AreEquivalent(files, o.Files);

            try
            {
                o.Validate();
            }
            catch (Exception)
            {
                Assert.Fail("Exception thrown durring validate.");
            }
        }

        [Test]
        [ExpectedException(typeof(Exception))]
        public void NullFilesTest()
        {
            string[] files = null;

            var o = new SendImagesOptions()
            {
                Files = files
            };

            Assert.IsNotNull(o);
            Assert.AreEqual(files, o.Files);

            o.Validate();
        }

        [Test]
        [ExpectedException(typeof(Exception))]
        public void EmptyFilesTest()
        {
            string[] files = { };

            var o = new SendImagesOptions()
            {
                Files = files
            };

            Assert.IsNotNull(o);
            CollectionAssert.AreEquivalent(files, o.Files);

            o.Validate();
        }

    }
}
